home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / spiele / publicdomain / elan / src / os2 / console.h < prev    next >
C/C++ Source or Header  |  1996-04-27  |  1KB  |  41 lines

  1.  
  2. /*** ANSI console I/O for Unix systems ***/
  3.  
  4. #include <stdio.h>
  5. #include <stdarg.h>
  6.  
  7. #define ANSI_COLORS_NUMBER        16
  8. #define ANSI_PAIRS_NUMBER        (ANSI_COLORS_NUMBER * ANSI_COLORS_NUMBER)
  9. #define REVERSE_BASE            ANSI_PAIRS_NUMBER
  10. #define PEN_NUMBER                (2 * REVERSE_BASE)
  11.  
  12. #define reverse_pen(pen)        (REVERSE_BASE + (pen))
  13. void locate(signed char i, signed char j);
  14. void clear_screen(void);
  15. void clear_to_eos(void);
  16. void clear_to_eol(void);
  17. void show_cursor(void);
  18. void hide_cursor(void);
  19. void begin_redraw(void);
  20. void end_redraw(void);
  21. void write_char(char output_char);
  22. void write_string(const char *string);
  23.  
  24. #define STRING_MAX_LEN            4096    /* Usato in con_printf */
  25.  
  26. typedef struct colors_pair
  27. {
  28.     int fg;
  29.     int bg;
  30. } colors_pair;
  31.  
  32. /* Protos */
  33. int open_console(const char *title_string, int x, int y, int l, int h);
  34. void close_console(void);
  35. char read_char(void);
  36. char async_read_char(void);
  37. void con_printf(const char *format_string, ...);
  38. int register_pen(colors_pair pair);
  39. void set_pen(int pen);
  40.  
  41.